
import https from "../../https";
import type { login, User, UserListParm,AssignParm,UpdateParm,SwitchParm } from "./UserModel";
//新增角色
export const addApi = (parm:User) =>{
    return https.post("/api/sysUser",parm)
}
//列表
export const getListApi = (parm:UserListParm) =>{
    return https.get("/api/sysUser/list",parm)
}
//根据用户id查询角色
export const getRoleListApi = (userId:string) =>{
    return https.get("/api/sysUser/getRoleList",{userId:userId})
}
//编辑
export const editApi = (parm:User) =>{
    return https.put("/api/sysUser",parm)
}
//删除
export const deleteApi = (userId:string) =>{
    return https.delete(`/api/sysUser/${userId}`)
}
//重置密码
export const resetPasswordApi = (parm:{userId:string}) =>{
    return https.post("/api/sysUser/resetPassword",parm)
}
//验证码
export const getImgApi = () =>{
    return https.post("/api/sysUser/getImage")
}
//登录
export const loginApi=(parm:login)=>{
    return https.post("/api/sysUser/login",parm)
}
//查询权限树数据
export const getAssignTreeApi = (parm:AssignParm) =>{
    return https.get("/api/sysUser/getAssignTree",parm)
}
//修改密码
export const updatePasswordApi = (parm:UpdateParm) =>{
    return https.post("/api/sysUser/updatePassword",parm)
}
//获取用户信息
export const getInfoApi = (userId:string) =>{
    return https.get("/api/sysUser/getInfo",{userId:userId})
}
//退出登录
export const loginOutApi = () =>{
    return https.post("/api/sysUser/loginOut")
}
//启用停用用户
export const enabledApi = (parm:SwitchParm)=>{
    return https.post("/api/sysUser/enabledUser",parm)
}
//医生下拉
export const getSelectUserApi = (deptId:string) =>{
    return https.get("/api/sysUser/getSelectUser",{deptId:deptId})
}